# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=linux-smart-enumeration
pkgver=299.eb80976
pkgrel=1
pkgdesc='Linux enumeration tool for pentesting and CTFs with verbosity levels.'
arch=('any')
groups=('blackarch' 'blackarch-scanner')
url='https://github.com/diego-treitos/linux-smart-enumeration'
license=('GPL2')
depends=('bash')
makedepends=('git')
source=("git+https://github.com/diego-treitos/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 755 -t "$pkgdir/usr/share/$pkgname/" lse.sh

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE

  cp -a --no-preserve=ownership doc/ screenshots/ \
    "$pkgdir/usr/share/doc/$pkgname"

  ln -sf "/usr/share/$pkgname/lse.sh" "$pkgdir/usr/bin/$pkgname"
}

